/*
 * OrientedKruskal.h
 *
 *  Created on: Oct 3, 2012
 *      Author: alberto
 */

#ifndef ORIENTEDKRUSKAL_H_
#define ORIENTEDKRUSKAL_H_

#include "Utilities.h"
#include "UnionFindSet.h"

#include <opencv2/core/core.hpp>
#include <opencv2/imgproc/imgproc.hpp>

#include <iostream>
#include <cassert>
#include <cstdlib>
#include <string>
using namespace std;
using namespace cv;

class OrientedKruskal {
public:
	OrientedKruskal(const Mat& gp);
	virtual ~OrientedKruskal();
	vector<size_t> getTree();
	void sortPositions();
	UnionFindSet getSet();
	vector<size_t> solve();

private:
	Mat graph;
	size_t grows;
	vector<size_t> tree;
	vector<pair<size_t, float> > sortedWeights;
	UnionFindSet dset;

};

#endif /* ORIENTEDKRUSKAL_H_ */
